<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('编辑承办部门')"/>
    <link th:href="@{/ajax/libs/bootstrap-tagsinput/tagsinput.css}" rel="stylesheet">
    <link th:href="@{/ajax/libs/jQuery-ui/jquery-ui.css}" rel="stylesheet">

</head>
<style>
    .bootstrap-tagsinput > input {
        display: none;
    }
</style>

<body style="background-color: #F4F6FA">
<div class="main-content" style="margin: 0;padding: 0">

    <form id="form-user-edit" th:object="${sendBackEty}"  class="form-horizontal" style="background-color: #F4F6FA">
        <input id="pkId" name="pkId" type="hidden" th:field="*{pkId}"/>
        <input id="flagInt" name="flagInt" type="hidden" value="0"/>
        <input id="flagString" name="flagString" type="hidden" value=""/>
        <input id="spareInt" name="spareInt" type="hidden" value="0"/>
        <input id="spareString" name="spareString" type="hidden" value=""/>

        <input id="sbGetDealPK" name="getDealPk" type="hidden" th:field="*{getDealPk}"/>
        <input id="sbCallID" name="callId" type="hidden" th:field="*{callId}"/>
        <input id="sbTapeID" name="tapeId" type="hidden" th:field="*{tapeId}"/>
        <input id="sbWfId" name="wfId" type="hidden" th:field="*{wfId}"/>
        <input id="sbOriLevel" name="oriLevel" type="hidden" th:field="*{oriLevel}"/>

        <input id="txtState" name="sendState" type="hidden" value="10"/>
        <input type="hidden" value="-1" name="callId">
        <input type="hidden" value="-1" name="tapeId">
        <div class="col-sm-12" style="display: flex">
            <div class="col-sm-12 entering-page">
                <!--    承办部门    -->
                <div class="col-sm-12 tltieBoder">
                    <div class="blueBorder"></div>
                    <h4 style="margin:0 0 0 10px">管理窗口-承办部门</h4>
                </div>
                <!-- 工单编号,工单性质..-->
                <div class="col-sm-12 work-top">
                    <div class="form-group col-sm-4">
                        <label>工单编号</label>
                        <input th:value="${workFromBase.workFormNo}" disabled type="text" name="workFormNo"
                               class="form-control" id="workNumber"
                               placeholder="请输入名称">
                    </div>
                    <div class="form-group col-sm-4">
                        <label>工单性质</label>
                        <select th:value="${workFromBase.setProId}" name="setProId" id="workCharacter" class="form-control m-b phoneCategory">
                            <option value="">-请选择-</option>
                            <option value="11" selected>普通工单</option>
                            <option value="21">督办工单</option>
                            <option value="31">呈批工单</option>
                        </select>
                        <input th:value="${workFromBase.setProName}" type="hidden" name="setProName">
                    </div>
                    <div class="form-group col-sm-4">
                        <label>工单主题</label>
                        <input th:value="${workFromBase.wsTopic}" type="text" name="wsTopic"  class="form-control" id="workSubject"
                               placeholder="请输入名称">
                    </div>
                    <div class="form-group col-sm-4">
                        <label>承办单位<span style="color: red">*</span></label>
                        <input th:field="*{sbdeptName}" type="text" name="sbdeptName" class="form-control" id="deptShort" placeholder="" autocomplete="off"
                               onclick="SelectDept()" required="required">
                        <input th:field="*{sbdeptId}" type="hidden" name="sbdeptId" id="noUnit">
                        <div class="input-group-append " style="position: absolute;top: 35px;right: 30px;">
                            <span class="glyphicon glyphicon-list-alt" style="color: #206ef7"></span>
                        </div>
                    </div>
                    <div class="form-group col-sm-4">
                        <label>办理期限<span style="color: red">*</span></label>
                        <input th:field="*{backLimit}" type="text" name="backLimit"
                               class="form-control transaction" id="transaction"
                               placeholder="请输入名称" required="required">
                        <div class="input-group-append " style="position: absolute;top: 35px;right: 30px;">
                            <span class="glyphicon glyphicon-calendar"></span>
                        </div>
                    </div>
                    <div class="form-group col-sm-4">
                        <label class="is-required">交办次序<span style="color: red">*</span></label>
                        <select th:field="*{seqCode}" name="seqCode" id="workOrder" class="form-control m-b phoneCategory" required="required">
                            <option value="">-请选择-</option>
                            <option value="10" selected>初次交办</option>
                            <option value="20">再次交办</option>
                            <option value="30">三次交办</option>
                        </select>
                        <input th:field="*{seqName}" type="hidden" name="seqName">
                    </div>
                    <div class="form-group col-sm-4">
                        <label>办理性质<span style="color: red">*</span></label>
                        <select th:field="*{sortCode}" name="sortCode" class="form-control m-b phoneCategory" required="required">
                            <option value="">-请选择-</option>
                            <option value="11" selected>主办</option>
                            <option value="21"></option>
                        </select>
                        <input th:field="*{sortName}" type="hidden" name="sortName" value="主办">
                    </div>
                    <div class="form-group col-sm-4">
                        <label is-required>办理方式</label>
                        <select th:field="*{dealCode}" name="dealCode" id="transactionWay" class="form-control m-b phoneCategory" required="required">
                            <option value="">-请选择-</option>
                            <option value="11" selected>研究办理</option>
                            <option value="21">酌情办理</option>
                        </select>
                        <input th:field="*{dealName}" type="hidden" name="dealName" value="研究办理">
                    </div>
                    <div class="form-group col-sm-4">
                        <label>交办时间</label>
                        <input th:field="*{sendTime}" type="text" name="sendTime"  disabled class="form-control workTime" id="workTime" placeholder="请输入名称">
                    </div>
                </div>
                <!--工单备注-->
                <div class="col-sm-12">
                    <div class="col-sm-8">
                        <div class="form-group">
                            <label class="col-xs-12 entering-pd">办理要求：</label>
                            <textarea th:field="*{sendDesc}" name="sendDesc" maxlength="1000" class="form-control workRemark" rows="3"
                                      style="height: 150px"></textarea>
                            <span>还可以输入<i class="workRemarkI">1000</i>个文字</span>
                        </div>
                    </div>
                </div>
                <!--办理期限,备注..-->
                <div class="col-sm-12 work-top">
                    <div class="form-group col-sm-4">
                        <label>备注</label>
                        <input th:field="*{sendRemark}" name="sendRemark" type="text" class="form-control" id="remark" placeholder="请输入名称">
                    </div>
                    <div class="form-group col-sm-4">
                        <label>派发单位</label>
                        <input th:field="*{sdeptName}" name="sdeptName"  type="text" class="form-control" id="sdeptName"
                               placeholder="请输入名称">
                        <input th:field="*{sdeptId}" type="hidden" name="sdeptId" id="sdeptId" >
                    </div>
                    <div class="form-group col-sm-4">
                        <label>派发人</label>
                        <input th:field="*{suserName}" name="suserName"  type="text" class="form-control"
                               id="distributePerson"
                               placeholder="请输入名称">
                        <input th:field="*{suserNo}" type="hidden" name="suserNo" >
                    </div>
                    <input th:field="*{fpDirect}" name="fpDirect" id="fpDirect" type="hidden">
                </div>
            </div>
        </div>
    </form>
</div>

<script th:src="@{/ajax/libs/layui/laydate.js}"></script>
<th:block th:include="include :: footer"/>
<!--<th:block th:include="include :: select2-js" />-->
<script th:src="@{/ajax/libs/jquery-jqPaginator/jqPaginator.js}"></script>
<script th:src="@{/ajax/libs/bootstrap-tagsinput/tagsinput.min.js}"></script>
<script th:src="@{/ajax/libs/jQuery-ui/jquery-ui.js}"></script>
<script th:src="@{/js/deptdiag.js}"></script>


<script>
    var prefix = ctx + "system/mTelWF";
    let pkId = window.parent.$('#pkId').val();
    let getDealPk = window.parent.$('#getDealPK').val();

    function submitHandler() {
        if ($('#sdeptId').val() != $('#deptId').val()) {
            $('#fpDirect').val(1);
        } else {
            $('#fpDirect').val(0)
        }
        if ($.validate.form()) {
            let data = $('#form-user-edit').serializeArray();

            $.operate.save(prefix + '/cmnFile/edit', data);
        }
    }

    function SelectDept(){
        var config = {
            title:'选择承办部门',
            width:'1050',
            height:'400',
            url: ctx + 'system/test/deptTransfer',
            skin: 'layui-layer-gray',
            btn: ['关闭'],
            yes: function (index, layero) {
                layer.close(index);
            }
        }
        $.modal.openOptions(config);
    }

    function SonBackSingle(idS, nameS) {
        $('#deptShort').val(nameS);
        $('#noUnit').val(idS);
    }

    function SonDirectSingle(sdeptNo, sdeptName, dNo, dName) {
        $('#deptShort').val(dName);
        $('#noUnit').val(dNo);
        $('#sdeptName').val(sdeptName);
        $('#sdeptId').val(sdeptNo);
    }

</script>
</body>
</html>

